package com.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.pojo.sms.Sms_Seckill_Session;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * 秒杀活动场次表
 */
public interface Sms_Seckill_Session_Mapper extends BaseMapper<Sms_Seckill_Session> {

    @Select("select * from sms_seckill_session" +
            " where start_time " +
            " >= date(now())" +
            " and start_time < DATE_ADD(date(now()),INTERVAL 1 DAY) or" +
            " end_time" +
            " >= date(now())" +
            " and end_time < DATE_ADD(date(now()),INTERVAL 1 DAY)  limit #{arg0},#{arg1}")
    List<Sms_Seckill_Session> find_admin_Mei_Ri_All(@Param("page") Integer page,@Param("limit") Integer limit, Sms_Seckill_Session sss);
    @Select("select count(*) from sms_seckill_session" +
            " where start_time " +
            " >= date(now())" +
            " and start_time < DATE_ADD(date(now()),INTERVAL 1 DAY)" +
            " or end_time" +
            " >= date(now())" +
            " and end_time < DATE_ADD(date(now()),INTERVAL 1 DAY)")
    Long getCount(Sms_Seckill_Session sss);
}
